package org.example.jcclubsubjectcommon.enums;

import lombok.Getter;

/**
 * @author 啊昌
 * @date 2025/4/12 18:56
 * SubjectInfoTypeEnum 题目类型枚举
 * 1单选 2多选 3判断 4简答
 */
@Getter
public enum SubjectInfoTypeEnum {

	RADIO(1, "单选"),
	MULTIPLE(2, "多选"),
	JUDGE(3, "判断"),
	BRIEF(4, "简答"),
	;
	public  int code ;
	public  String desc;



	 SubjectInfoTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}


//	根据传递 codeVal 的 type 返回枚举类型
	public static SubjectInfoTypeEnum getByCode(int codeVal) {
		for (SubjectInfoTypeEnum typeEnum : SubjectInfoTypeEnum.values()) {
			if(typeEnum.getCode() == codeVal){
				return typeEnum;
			}
		}
		return null;
	}

}
